﻿using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Composite.Regions;
using Microsoft.Practices.Unity;
using WorldIndex.Modules.Countries.Views;

namespace WorldIndex.Modules.Countries
{
    public class MCountries : IModule 
    {
        private IRegionManager _regionManager;
        private IUnityContainer _container;

        public MCountries(IRegionManager regionManager, IUnityContainer container)
        {
            _regionManager = regionManager;
            _container = container;
        }

        public void Initialize()
        {
            _container.RegisterType<ICountryService, CountryService>();
            _regionManager.RegisterViewWithRegion("MainRegion", typeof(CountryListView));
        }
    }
}
